<HTML>
<BODY>
  <STYLE type="text/css">

.keyword {
    font-weight: bold;
    color: darkred;
}

.string {
    color: blue;
}

.code {
    font-family: Courier, "Free Mono";
    margin-left: 40px;
}

SMALL {
    color: darkgray;
}

  </STYLE>


<H2>FreeCol internationalisation</H2>

<P>This package contains the FreeCol support for internationalisation
(translation).

<P>The {@link net.sf.freecol.client.gui.i18n.Messages} class provides the API to
the translations.  Client code might include:

<P class=code>
<FONT class=keyword>new </FONT>AbstractAction( Messages.message(<FONT class=string>"cancel"</FONT>) )
</P>

..whereupon the Messages class will look for a file called:

<P class=code>
FreeColMessages<FONT color=green>[_la<FONT color=blue>[_CO]</FONT>]</FONT>.properties
</P>

..where <TT>_la</TT> and <TT>_CO</TT> are the language and country codes from the locale.  The
most specific file will be loaded.  With a US locale, <TT>Messages</TT> will
look for <TT>FreeColMessages_en_US.properties</TT> first, then
<TT>FreeColMessages_en.properties</TT> and finally
<TT>FreeColMessages.properties</TT> if neither of the other two are found.

<P><TT>FreeColMessages.properties</TT> contains a line like this:

<P class=code>
cancel=Cancel
</P>

..while <TT>FreeColMessages_hu.properties</TT> has a corresponding line:

<P class=code>
cancel=M&#xe9;gse
</P>


<H2>MessageMerge</H2>

<P>Only <TT>FreeColMessages.properties</TT> is updated as new messages are added
so a tool is required for translators to keep their translations up to date when
new messages are added.

<P>At the console, type:

<P class=code>
ant compile-test<BR>
java&nbsp;-cp&nbsp;src/classes&nbsp;net.sf.freecol.client.gui.i18n.MessageMerge&nbsp;<FONT color=red>src/net/sf/freecol/client/gui/i18n/FreeColMessages.properties</FONT>&nbsp;src/net/sf/freecol/client/gui/i18n/FreeColMessages_hu.properties
</P>

..where the red message file is the one to merge from (typically the one shown
above) and the black message file is the one to merge to.

<P><TABLE><TR><TD><IMG src="http://www.zen9658.zen.co.uk/MessageMerge.png" alt="MessageMerge screen" align=left style="margin-right:20px;">

<P>The screen shot shows "players" and "gameState" messages have been added. Select
the added messages from the left and press the [insert in right] button.

<P>To remove obselete or over-zealously inserted messages, select a range from
the right and press the [delete from right] button.

<P>Press the [save right] button to write the changes to the message file shown
on the right hand side. Doing so will destroy your translation file without
warning so ensure that the file on the right-hand side is committed to CVS
before pressing the button or you risk losing your work.
</TD></TR></TABLE>

<CENTER><SMALL>
$Revision: 1185 $ $Date: 2006-01-05 19:19:51 +1030 (Thu, 05 Jan 2006) $
</SMALL></CENTER>

</BODY>
</HTML>
